<%@page import="java.util.*"%>
<%@page import="com.hp.ccue.identity.util.*"%>
<%@page import="com.hp.ccue.identity.user.*"%>
<%@page import="com.hp.ccue.identity.user.idm.*"%>
<%@page import="com.hp.ccue.identity.user.idm.domain.*"%>
<%@page import="com.hp.ccue.identity.IdmClient"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IdM Groups List</title>
<style type="text/css">
body {
	width: 80%;
	height: 80%;
	position: absolute;
	margin-left: 50px;
	margin-top: 40px;
}

#userListHeader {
	color: green;
}

table#userList {
	border: solid 1px red;
	text-align: left;
	font-family: verdana, arial, sans-serif;
	font-size: 11px;
	color: #333333;
	border-width: 1px;
	border-color: #666666;
	border-collapse: collapse;
}
</style>
</head>
<body>
	<br>
	<%
	    String tenant = request.getParameter("tenant");
	    tenant = tenant == null ? "TestOrg" : tenant;

	    IdmUserService idmUserService = (IdmUserService) WebRequestContextUtils.getIdmClient().getIdmUserService();
	    Collection<IdmGroup> idmGroups1 = idmUserService.getGroupsByOrganization(tenant);
	%>
	<table id="userList" border=1>
		<tr id="userListHeader">
			<td>UUID</td>
			<td>Name</td>
			<td>DisplayName</td>
			<td>metadata</td>
			<td>Roles</td>
		</tr>
		<%
		    for (IdmGroup idmGroups : idmGroups1) {
		%>

		<tr>
			<td><%=idmGroups.getId()%></td>
			<td><%=idmGroups.getName()%></td>
			<td><%=idmGroups.getDisplayName()%></td>
			<td><%=idmGroups.getMetadata()%></td>
			<td><%=idmGroups.getRoles()%></td>
		</tr>
		<%
		    }
		%>
	</table>

</body>
</html>